package com.mccrea.pattern.handler;

/**
 * @Classname ClassAdviser
 * @Description 班主任类
 * @Date 2021/5/24 0024 16:29
 * @Created by Mccrea_Gao
 */
public class ClassAdviser extends Leader {
    @Override
    void handleRequest(int leaveDays) {
        if (leaveDays <= 2) {
            System.out.println("班主任批准" + leaveDays + "天假！");
        } else {
            if (getNext() != null) {
                getNext().handleRequest(leaveDays);
            } else {
                System.out.println("未批准" + leaveDays + "天假！");
            }
        }
    }
}
